package com.example.prom.converter;

import com.example.prom.model.Order;
import com.example.prom.vo.OrderVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

/**
 * @author dangwen1
 * @date 2021年12月03日 11:23
 * @description
 */
@Mapper
public interface OrderModelConverter extends BaseMapping<Order, OrderVO> {
    OrderModelConverter INSTANCE = Mappers.getMapper(OrderModelConverter.class);

    @Mappings({
//            @Mapping(source = "birthday", target = "birthday", dateFormat = "yyyy-MM-dd"), // format好像没什么用
            @Mapping(source = "channel", target = "channel", ignore = true)
    })
    @Override
    OrderVO sourceToTarget(Order var1);

    @Override
    Order targetToSource(OrderVO var1);
}
